function post(URL, PARAMS, target) {
	var temp_form = document.createElement("form");
	temp_form.action = URL;
	temp_form.target = target;
	temp_form.method = "post";
	temp_form.style.display = "none";
	for (var x in PARAMS) {
		var opt = document.createElement("textarea");
		opt.name = x;
		opt.value = PARAMS[x];
		temp_form.appendChild(opt);
	}
	document.body.appendChild(temp_form);
	temp_form.submit();
} //post函数定义
var et = contentPane.parameterEl.getWidgetByName("et").getValue();
var com = contentPane.parameterEl.getWidgetByName("com").getValue();
var project = contentPane.parameterEl.getWidgetByName("project").getValue();
var names = contentPane.parameterEl.getWidgetByName("project").getText();
alert(names);
console.log(project)
console.log(names)
let namess = names.split("','");
let projects = project.split("','");
for (let i = 0; i < projects.length; i++) {
	var sql = "sql(\"物业数仓读写\",\"SELECT substr(displayname_l2,8) FROM USER_S_W.DIM_ORG_ADMIN WHERE  adminorgid =\'" +
		projects[i] + "'\",1)"
	var A = FR.remoteEvaluate(sql);

	post("/webroot/decision/view/report?viewlet=pc/3_物业/0_填报/收入成本/盈亏对比/全科目_公司明细bak.cpt", {
		et: et,
		com: com,
		project: projects[i],
		fine_username: 'root',
		qy: '1',
		op: "write",
		format: "excel",
		extype: "simple",
		__filename__: "导出"
	}, "_blank")
}
